﻿<phone:PhoneApplicationPage x:Class="nRoute.Themes.AboutError"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    mc:Ignorable="d"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:nBehaviors="clr-namespace:nRoute.Behaviors" 
	xmlns:nComponents="clr-namespace:nRoute.Components" 
	xmlns:nNavigation="clr-namespace:nRoute.Navigation" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
	nNavigation:Navigation.Title="Navigation Problem"
    d:DesignHeight="800" d:DesignWidth="480">

    <phone:PhoneApplicationPage.Resources>
        <nComponents:ValueConverterRelay x:Key="TitleConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="SubTitleConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="ReturnUrlConverterRelay" />
        <nComponents:ValueConverterRelay x:Key="RetryUrlConverterRelay" />
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"  />
            <RowDefinition/>
        </Grid.RowDefinitions>

        <!--TitleGrid is the name of the application and page title-->
        <TextBlock Text="{Binding ResponseStatus, Converter={StaticResource TitleConverterRelay}, Mode=OneWay}"
			Style="{StaticResource PhoneTextNormalStyle}"  HorizontalAlignment="Left" Margin="12,17,0,0" />

        <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="1" VerticalContentAlignment="Top" 
			BorderThickness="0" BorderBrush="{x:Null}" Margin="0,0,0,0">
            <StackPanel d:LayoutOverrides="Width" Margin="12,0,12,0">

                <TextBlock x:Name="SubTitleText" TextWrapping="Wrap" FontSize="26.667" 
					Margin="0,0,0,13" Foreground="{StaticResource PhoneAccentBrush}" 
	                Text="{Binding ResponseStatus, Converter={StaticResource SubTitleConverterRelay}, Mode=OneWay}"/>

                <TextBlock x:Name="ErrorMessageText" Foreground="{StaticResource PhoneSubtleBrush}" 
					Text="{Binding Error.Message, Mode=OneWay}" 
					TextWrapping="Wrap" Margin="0,0,0,10" FontSize="26.667">
	        		<i:Interaction.Behaviors>
	        			<nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Error, Mode=OneWay}"/>
	        		</i:Interaction.Behaviors>
                </TextBlock>

                <!-- NEED TO MAYBE REMOVE SOME OF THESE WHEN USING FRAME -->
                <HyperlinkButton x:Name="NavigateReturnText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10" 
					VerticalAlignment="Bottom" Content="{Binding RefererRequest, Converter={StaticResource ReturnUrlConverterRelay}, Mode=OneWay}" 
					Foreground="{StaticResource PhoneForegroundBrush}" Click="Link_NavigateReturn" FontSize="26.667"
					HorizontalContentAlignment="Left">
                    <i:Interaction.Behaviors>
                        <nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding RefererRequest, Mode=OneWay}"/>
                    </i:Interaction.Behaviors>
                </HyperlinkButton>

                <HyperlinkButton x:Name="NavigateRetryText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10"
					VerticalAlignment="Bottom" Content="{Binding Request, Converter={StaticResource RetryUrlConverterRelay}, Mode=OneWay}" 
					Foreground="{StaticResource PhoneForegroundBrush}" Click="Link_NavigateRetry" FontSize="26.667"
					HorizontalContentAlignment="Left">
                    <i:Interaction.Behaviors>
                        <nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Request, Mode=OneWay}"/>
                    </i:Interaction.Behaviors>
                </HyperlinkButton>

                <HyperlinkButton x:Name="NavigateBackText" Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,10" 
					VerticalAlignment="Bottom" Content="Navigate Back" FontSize="26.667" HorizontalContentAlignment="Left"
					Foreground="{StaticResource PhoneForegroundBrush}" Click="Link_NavigateBack">
                    <i:Interaction.Behaviors>
                        <nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding DirectionalNavigationHandler, Mode=OneWay}"/>
                    </i:Interaction.Behaviors>
                </HyperlinkButton>

                <HyperlinkButton x:Name="MoreInfoText" Cursor="Hand" HorizontalAlignment="Left" VerticalAlignment="Bottom" 
					Content="Click for Error Details" Margin="0,0,0,10" FontSize="26.667" HorizontalContentAlignment="Left">
                    <i:Interaction.Behaviors>
                        <nBehaviors:NullValueVisibilityBehavior ValueBinding="{Binding Error, Mode=OneWay}"/>
                    </i:Interaction.Behaviors>
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <nBehaviors:TargetedSetPropertyAction TargetName="textBox" 
								PropertyName="Visibility" Value="Visible"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </HyperlinkButton>

                <TextBox x:Name="textBox" Text="{Binding Error, Mode=OneWay}" TextWrapping="Wrap" BorderThickness="1" 
					MinHeight="150" MaxHeight="700"  AcceptsReturn="True" IsReadOnly="True" Foreground="{StaticResource PhoneContrastForegroundBrush}"
					BorderBrush="{StaticResource PhoneTextBoxBrush}" VerticalScrollBarVisibility="Auto"
					Background="{StaticResource PhoneTextBoxBrush}" Visibility="Collapsed" FontSize="16" />

            </StackPanel>
        </ScrollViewer>

    </Grid>
</phone:PhoneApplicationPage>